package com.yzk.train.business.controller;

import com.yzk.train.business.request.DailyTrainTicketQueryReq;
import com.yzk.train.business.response.DailyTrainTicketQueryResp;
import com.yzk.train.business.service.DailyTrainTicketService;
import com.yzk.train.common.response.PageResp;
import com.yzk.train.common.response.Result;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ticket")
public class TicketController {

    @Resource
    private DailyTrainTicketService dailyTrainTicketService;

    @GetMapping("/list")
    public Result<PageResp<DailyTrainTicketQueryResp>> queryList(@Valid DailyTrainTicketQueryReq req) {
        PageResp<DailyTrainTicketQueryResp> pageResp = dailyTrainTicketService.queryList(req);
        return Result.ok(pageResp);
    }

}
